Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Exponential Backoff for Route53 Throttling in dns_aws.sh #6205

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

foxdalas
Copy link

@foxdalas foxdalas commented Jan 18, 2025

Hello it is small improvement for Route53 (dns_aws)

Description:

  • Introduces a simple retry mechanism in aws_rest() with exponential backoff for AWS Route53 throttling errors (Throttling, RequestThrottled, RateLimit, or Rate exceeded).
  • No other changes have been made, and the existing logic is preserved.
  • Ensures that acme.sh can gracefully handle rate-limited requests to Route53 instead of failing immediately.

Why:

  • When Route53 is under heavy load, AWS may respond with a throttling error. Without retries, the request fails and the certificate issuance is disrupted.
  • This backoff approach retries the request up to five times, doubling the wait each time, allowing enough time for Route53 to recover from throttling.

How:

  • Added a while loop in aws_rest() with a maximum of five attempts (max_retries=5).
  • On each throttling error, we sleep for exponentially longer intervals (_sleep_time = base_sleep * 2^(attempt-1)).
  • If throttling persists beyond the maximum attempts, we return an error to maintain backward compatibility.

Testing:

  • Manually tested by simulating throttling responses. Verified that the script retries and succeeds once AWS is ready to accept requests again.

Thank you for reviewing!

Copy link

Welcome
First thing: don't send PR to the master branch, please send to the dev branch instead.
Please make sure you've read our DNS API Dev Guide and DNS-API-Test.
Then reply on this message, otherwise, your code will not be reviewed or merged.
Please also make sure to add/update the usage here: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2
We look forward to reviewing your Pull request shortly ✨
注意: 必须通过了 DNS-API-Test 才会被 review. 无论是修改, 还是新加的 dns api, 都必须确保通过这个测试.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant